-
Notifications
You must be signed in to change notification settings - Fork 82
Delete: Self-Destruct #2046
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delete: Self-Destruct #2046
Conversation
Improves the self_destruct method to schedule deletion for all users with the 'activitypub' capability, logs each scheduled user, and updates messaging for clarity. Adds an option to mark the deletion process and instructs users to keep the plugin active until completion.
Enhanced the self_destruct command to provide clearer warnings, detailed process steps, and progress feedback when deleting a blog from the Fediverse. Added checks for user existence, improved error handling, and clarified next steps for users after scheduling deletions.
Implements a mechanism to check when all Delete activities for ActivityPub self-destruct are processed, removes the self-destruct flag, and displays an admin notice upon completion. Enhances user feedback and ensures proper cleanup after self-destruct operations.
Changed the action hook from 'activitypub_self_destruct_processing_complete' to 'activitypub_outbox_processing_complete' and updated the method signature for check_self_destruct_completion to accept only inboxes and JSON. Adjusted post type, status, and meta key in the pending deletes query for consistency with Outbox implementation.
Co-authored-by: Copilot <[email protected]>
Replaces direct parameters with an Activity object when adding a 'Delete' activity to the outbox. This change improves consistency and leverages the Activity class for better structure.
The self_destruct WP-CLI command for ActivityPub is now refactored for modularity and clarity, with improved documentation, confirmation handling, and status checking. The process is split into smaller private methods, and a new --status flag allows users to check progress. The self-destruct completion logic and related hook are removed from Scheduler, and status tracking is now handled directly in the CLI command.
Standardized inline comments by adding missing periods for consistency and improved readability in class-cli.php.
Co-authored-by: Copilot <[email protected]>
AI sure loves their emoji |
not good? |
I don't care too much but others might. Having one on every line arguably makes their effects moot. |
Co-authored-by: Konstantin Obenland <[email protected]>
Co-authored-by: Konstantin Obenland <[email protected]>
Adjusted the alignment of 'key' and 'value' in the meta_query array for better code readability and consistency.
Emojis were removed from the progress and note messages in the self-destruct process output to improve compatibility and readability in CLI environments.
Consolidated and reformatted the message shown when the self-destruct process has not started, making the command to run more visible and easier to follow.
Replaces the import of Followers with Outbox in the class-cli.php file to ensure correct class usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a self-destruct feature for ActivityPub that allows users to completely remove their blog from the Fediverse by sending Delete activities to all followers. This is an irreversible operation designed to provide a clean exit mechanism from ActivityPub networks.
- Adds a comprehensive CLI command
wp activitypub self_destruct
with confirmation prompts, status checking, and progress tracking - Implements completion detection that monitors pending Delete activities and provides admin notifications when the process finishes
- Provides user-friendly feedback and safety measures including warnings, confirmation prompts, and status monitoring
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
includes/class-cli.php | Implements the main self-destruct CLI command with user confirmation, progress tracking, and status checking functionality |
includes/wp-admin/class-admin.php | Adds admin notice display for self-destruct completion notifications |
.github/changelog/2046-from-description | Adds changelog entry for the new self-destruct feature |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Fixes #2099.
This PR implements a self-destruct feature for ActivityPub that allows users to remove their blog from the Fediverse by sending Delete activities to all followers. The implementation includes a CLI command, completion tracking, and admin notifications.
Proposed changes:
wp activitypub self_destruct
CLI command with confirmation prompts and progress trackingOther information:
Testing instructions:
wp activitypub self_destruct
in the CLIDelete
ActivitiesChangelog entry
Changelog Entry Details
Significance
Type
Message
Adds a self-destruct feature to remove a blog from the Fediverse by sending Delete activities to followers.